﻿using System;
using System.Collections.Generic;
using System.Text;
//MicroDesigner
using Jc.MicroDesigner.Objects;
using Jc.MicroDesigner.Management;
using Jc.MicroDesigner.Drawings;

namespace Jc.MicroDesigner.ElementsLib
{
    /// <summary>
    /// Элемент "3И"
    /// </summary>
    [DrawingToolItem("3И")]
    public class AND3 : RealElement
    {
        public AND3(ObjectManager manager) : base(manager, "and3.xml") { }

        protected override sbyte ComputeSignal()
        {
            sbyte a = _PINCollection[0].Signal;
            sbyte b = _PINCollection[1].Signal;
            sbyte c = _PINCollection[2].Signal;
            sbyte value = Convert.ToSByte((a == 1 && b == 1 && c == 1) ? 1 : 0);
            return value;
        }
    }
}